feat(legalizer): add GlobalISel-like legalization framework - #1234
Draft
naveen-seth wants to merge 1 commit into
Draft
feat(legalizer): add GlobalISel-like legalization framework#1234naveen-seth wants to merge 1 commit into
naveen-seth wants to merge 1 commit into
Conversation
naveen-seth
force-pushed
the
legalizer-infrastructure
branch
3 times, most recently
from
August 12, 2026 23:06
c1656e0 to
7adef31
Compare
This adds the basic framework for building legalization passes in the same way as LLVM's GlobalISel. This currently just defines the rule actions needed for G_ADD/G_SUB in the 64-bit RISC-V legalization pass. (Very WIP. Top-level documentation is mostly just copied from LLVM.)
naveen-seth
force-pushed
the
legalizer-infrastructure
branch
from
August 13, 2026 07:33
7adef31 to
11015e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is how we could structure our legalization passes to somewhat match LLVM’s GlobalISel approach.
For now, it defines the rule actions needed for
G_ADD/G_SUBin the 64-bit RISC-V legalization pass.WIP, draft opened for Thursday's meeting.
The code surrounding typeIndex has no real use yet, but should make more sense as we add more rules.
The current top-level documentation is mostly copied from LLVM.